package com.coda.app.mapper;

import com.coda.entity.PaymentType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PaymentTypeMapper {
    /**
     * 获取全部支付方式
     * @return
     */
    @Select("select * from payment_type")
    List<PaymentType> getPaymentList();

    /**
     * 根据房间id获取支付方式
     * @return
     */
    List<PaymentType> getRoomPaymentList(Long id);

    /**
     * 根据id获取支付方式
     * @param paymentTypeId
     * @return
     */
    @Select("select * from payment_type where id = #{paymentTypeId}")
    PaymentType getPaymentById(Long paymentTypeId);
}
